package com.xindaoapp.happypet.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.EditText;
import android.widget.TextView;

import com.xindaoapp.happypet.R;
import com.xindaoapp.happypet.utils.Constants;

/**
 * 显示加尾巴的dialog
 * 
 * @author
 * 
 */
public class ShareWeibaDialogActivity extends Activity {


    private EditText content;
    private TextView title, cancel, ok;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_share_weiba_dialog);

        init();

        title.setText(getIntent().getStringExtra("title"));



    }

    private void init() {
        // TODO Auto-generated method stub
        content = (EditText) this.findViewById(R.id.editText1);
        title = (TextView) this.findViewById(R.id.tv_title);
        cancel = (TextView) this.findViewById(R.id.cancel);
        ok = (TextView) this.findViewById(R.id.ok);

        cancel.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                finish();
            }
        });

        ok.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                Intent data = new Intent();
                data.putExtra(Constants.SHARECONTENT, content.getText().toString());
                setResult(Activity.RESULT_OK, data);
                finish();
            }
        });

    }



}
